package main

import "fmt"

func swap(a int, b int) {
	var temp int
	temp = a  // 10
	a = b	 	// a = 20
	b = temp   // b = 10
	fmt.Println("a = ", a, "b = ", b)
}

func swapPointer(pa *int, pb *int)  {
	var temp int
	temp = *pa   // 10
	*pa = *pb    // a = 20
	*pb = temp	 // b = 10
}
func main() {
	var a = 10
	var b = 20

	swap(a, b)
	fmt.Println("a = ", a, "b = ", b)
	swapPointer(&a, &b)
	fmt.Println("a = ", a, "b = ", b)
}
